<?php
/* @var $this CategoryController */
/* @var $model Category */
/* @var $form CActiveForm */
?>
<div class="clearfix fix-float-left">
    <?php $form=$this->beginWidget('bootstrap.widgets.TbActiveForm',array(
    'id'=>'category-form',
    'enableAjaxValidation'=>true,
    'enableClientValidation'=>true,
    'clientOptions'=>array(
        'validateOnSubmit'=>true,
    )
)); ?>
    <div class="alert alert-info">
        <button type="button" class="close" data-dismiss="alert">&times;</button>
        <p><strong>
            <span class="icon16  brocco-icon-mic"></span>
            <?php echo t('Fields with <span class="required">*</span> are required.','fcms'); ?>
        </strong></p>
    </div>
    <div class="row-fluid">
        <div class="span6">
            <fieldset>
            <legend><?php echo t('BASIC','category'); ?></legend>
                <?php echo $form->textFieldRow($model,'name',array('class'=>'span8','maxlength'=>255,'prepend'=>'<i class="entypo-icon-flash"></i>')); ?>

                <?php echo $form->textFieldRow($model,'slug',array('class'=>'span8','maxlength'=>255,'prepend'=>'<i class="entypo-icon-flash"></i>')); ?>

                <?php $this->widget('backend.widgets.Slug.fSlug', array(
                    'model'=>$model,
                    'source' => 'name',
                    'target' => 'slug',
                )); ?>

            <?php
            echo $form->dropDownListRow($model, 'parent_id', Category::getDataCategory(),
            array(
                'class'=>'span5',
            ));
            ?>



            <?php echo $form->toggleButtonRow($model, 'is_active',array('class'=>'nostyle')); ?>

                <?php
                echo $form->label($model,'image');
                $this->widget('common.extensions.elfinder.ServerFileInput', array(
                        'model' => $model,
                        'attribute' => 'image_large',
                        'showImage'=>true,
                        'noImageAvailable'=>settings()->get('general','no_image_available'),
                        'htmlOptions'=>array(
                            'class'=>'nostyle clearfix'
                        ),
                        'connectorRoute' => 'elfinder/connector',
                    )
                );
                echo $form->error($model,'image_large');
                ?>
            </fieldset>
        </div>

        <div class="span6">
        <fieldset>
            <legend><?php echo t('SEO','category'); ?></legend>
        <?php echo $form->textFieldRow($model,'title',array('class'=>'span5','maxlength'=>255)); ?>

        <?php
            echo $form->label($model,'meta_keyword');
            $this->widget('bootstrap.widgets.TbSelect2', array(
                'asDropDownList' => false,
                'form'=>$form,
                'model'=>$model,
                'attribute'=>'meta_keyword',
                'options'=>array(
                    'tags'=>array('FCMS'),
                    'placeholder'=>'Keyword',
                    'allowClear'=>true,
                    'width'=>'40%'
                ),
            ));
            echo $form->error($model,'meta_keyword');
            ?>

            <?php
            echo $form->label($model,'meta_robots');
            $this->widget('bootstrap.widgets.TbSelect2', array(
                'asDropDownList' => false,
                'form'=>$form,
                'model'=>$model,
                'attribute'=>'meta_robots',
                'options'=>array(
                    'tags'=>metaRobots(),
                    'placeholder'=>'Robots',
                    'allowClear'=>true,
                    'width'=>'40%',
                    'maximumSelectionSize'=>1
                ),
            ));
            echo $form->error($model,'meta_robots');
            ?>
            <?php
            echo $form->label($model,'meta_revisit_after');
            $this->widget('bootstrap.widgets.TbSelect2', array(
                'asDropDownList' => false,
                'form'=>$form,
                'model'=>$model,
                'attribute'=>'meta_revisit_after',
                'options'=>array(
                    'tags'=>metaRevisitAfter(),
                    'placeholder'=>'Revisit Afer',
                    'allowClear'=>true,
                    'width'=>'40%',
                    'maximumSelectionSize'=>1
                ),
            ));
            echo $form->error($model,'meta_revisit_after');
            ?>
            <?php echo $form->textAreaRow($model,'meta_description',array('class'=>'span5')); ?>
        </fieldset>

        </div>


    </div>
    <div class="form-actions">
        <?php $this->widget('bootstrap.widgets.TbButton', array(
        'buttonType'=>'submit',
        'type'=>'primary',
        'label'=>$model->isNewRecord ? t('Create') : t('Save'),
    ));
        $this->widget('bootstrap.widgets.TbButton', array(
            'buttonType'=>'reset',
            'label'=>t('Reset'),
        ));
        ?>
    </div>

    <?php $this->endWidget(); ?>
</div>